import os
import configparser

def newdd(path):
    isExists = os.path.exists(path)
    if not isExists:
        os.makedirs(path)

def make_dirs():
    config = configparser.ConfigParser()
    config.sections()
    config.read('man.ini',encoding="utf-8-sig")
    config.sections()

    current_path = os.path.abspath('.')

    j1 = ['顺光','逆光','侧光','阴影']  # 人名目录下的一级目录列表
    j2 = ['带眼镜','无眼镜']            # 一级目录下的二级目录列表
    
    for x in range(1,41):
        
        x_str = str(x).zfill(2)
        tag_i = 'a' + x_str
        name_i = config['DEFAULT'][tag_i]
        if name_i == '0' or name_i == '':
            continue
        new_man_path = os.path.join(current_path,name_i)
        newdd(new_man_path)
        for ele_j1 in j1:
            j1_path = os.path.join(new_man_path,ele_j1)
            newdd(j1_path)
            for ele_j2 in j2:
                j2_path = os.path.join(j1_path,ele_j2)
                newdd(j2_path)

make_dirs()
